﻿CKEDITOR.dialog.add( 'textarea', function( editor ) {
        return {
                title: editor.lang.uflo.textarea.title,
                minWidth: 300,
                minHeight: 120,
                contents: [
                        {
                        id: 'info',
                        label: editor.lang.uflo.textarea.title,
                        title: editor.lang.uflo.textarea.title,
                        elements: [
   								{
				                    id: 'bindingfield',
				                    type: 'select',
									style:"width:300px",
				                    label: editor.lang.uflo.textfield.bindingfiled,
				                    'default': '',
									items: window.formTable.getMasterColumns(),
				                    accessKey: 'N',
				                    setup: function(widget) {
                                        this.setValue(widget.element.getAttribute( 'bindingfield' ) );
	                                },
	                                commit: function( widget ) {
                                        widget.setData( 'bindingfield', this.getValue() );
	                                }
								},
								{
									type: "hbox",
									widths: ['50%','50%'],
									children: [
										{
											id: 'width',
											type: 'text',
											style: "width:145px",
											label: editor.lang.uflo.textfield.charWidth,
											'default': '100%',
											setup: function(widget){
												var element = widget.element;
												var styles=element.getAttribute("style");
												if(styles){
													var style=styles.split(";");
													for(var i=0;i<style.length;i++){
														var item=style[i].split(":");
														if(item[0]=="width"){
															this.setValue(item[1]);
															break;
														}
													}
												}									
											},
											commit: function(widget){
												widget.setData("width",this.getValue());
											}									
										},
										{
											id: 'height',
											type: 'text',
											style: "width:145px",
											label: "编辑框高度",
											'default': '60px',
											setup: function(widget){
												var element = widget.element;
												var styles=element.getAttribute("style");
												if(styles){
													var style=styles.split(";");
													for(var i=0;i<style.length;i++){
														var item=style[i].split(":");
														if(item[0]=="height"){
															this.setValue(item[1]);
															break;
														}
													}
												}	
											},
											commit: function(widget){
												widget.setData("height",this.getValue());
											}									
										}
									]
								}
                        ]
                }
                ]
        };
});